#ifndef SC_TERM_H
#define SC_TERM_H

#include "common.h"

#include <stdbool.h>

/**
 * Return the terminal dimensions.获取命令行终端可容纳的字符规模
 *
 * @return Return false if the dimensions could not be retrieved.
 * @param rows 如果rows不为NULL，就回写行数
 * @param cols 如果cols不为NULL，就回写每行能容纳的字符数
 * Otherwise, return true, and:
 *  - if `rows` is not NULL, then the number of rows is written to `*rows`.
 *  - if `columns` is not NULL, then the number of columns is written to
 *    `*columns`.
 */
bool
sc_term_get_size(unsigned *rows, unsigned *cols);

#endif
